This application claims the priority benefit of Taiwan application serial no. 90119199, filed Aug. 7, 2001.
1. Field of the Invention
This invention relates to the field of mass storage device, and more particularly, to a window-based flash memory storage system and a management method and an access method thereof.
2. Description of Related Art
A flash memory storage system is typically composed of two main components: a flash memory unit and an access controller; wherein the flash memory unit is used for data storage, while the access controller is used to control the access operation from the CPU to the flash memory as well as manage the data storage space of the flash memory. The access controller is typically composed of a microprocessor, a ROM unit, an SRAM unit, a flash memory interface, and a CPU interface; wherein the ROM unit is used to store the program code running on the microprocessor; the SRAM unit is used to store window-related information and also serves as a data buffer between the flash memory and the CPU; the CPU interface is used to allow the access controller to communicate with the CPU; and the flash memory interface is used to allow the access controller to gain access to the data stored in the flash memory.
The data storage space of the flash memory is partitioned into a plurality of blocks, and most blocks are categorized into a number of subgroups, called windows. We use some specific blocks to record the related information of each window (hereinafter referred to as window information). In order to reduce SRAM cost, a common practice is to store all the window information in the flash memory and only a part of the window information that is essential to window operation is loaded to the SRAM.
When it is desired to perform a read/write operation on a certain window, it is required to first load the associated window information of this window into the SRAM. In the event of a sudden power failure, however, some newly-updated window information currently stored in the SRAM would be lost, and thus the flash memory still stores the old version of the window information. Consequently, in the next operation of the same window when power is resumed to normal, the older version of the window information will be loaded to the SRAM, resulting in the use of incorrect window information.
Furthermore, when a read/write operation is to be performed on a certain sector of the active window, it would involve many stages of operations. If there are two sectors to be accessed, the currently used method is to execute the read/write operation on the first sector until all the stages are completed and then proceed to the read/write operation on the next sector. This sequential access method is undoubtedly low in efficiency. One conventional solution to this problem is to use two or more flash memory banks to perform an interleaving read/write operation to help increase the access speed. One drawback to this solution, however, is that it is limited in functionality and would have the penalty of an overly large power consumption.
It is therefore an objective of this invention to provide a window-based flash memory storage system and a management and an access method thereof, which can provide a more reliable way of loading window information and can help enhance access performance through parallel pipelined operation on the reading/writing of a number of sectors.
The window-based flash memory storage system according to the invention includes a window-based region and a redundant reserved region, wherein the window-based region is used to store a number of windows, each window being associated with a number of physical blocks. The redundant reserved region includes a dynamic-link area, a window-information area, a dynamic-link information area, and a boot-information area; wherein the dynamic-link area includes a plurality of dynamic allocation blocks, each being allocatable to any window. The window-information area includes a plurality of window information blocks, which are used to store a specific window-information set that is dedicated to a certain window. The dynamic-link information area is used to record the status of the allocation of the dynamic allocation blocks to the windows.
Further, the invention proposes a management method for the window-based flash memory storage system. The window-based flash memory storage system includes a flash memory unit having a plurality of window-information blocks, each being used to store a plurality of window-information sets, each window-information set being associated with a window. By this management method, at the start of the window-based flash memory storage system, the first step is to select a subgroup of the window-information blocks; and from the selected window-information blocks, selecting one window-information set and loading the selected window-information set into an SRAM unit. Then, the window-information set associated with a user-selected window is put into an active-window variable area of the SRAM; and when another window is switched to the active window, moving the current window-information set stored in the active-window variable area to a reserved window in the SRAM. In the event a user-selected window is unassociated with any window-information sets stored in the SRAM, one of the window-information sets is selected and a backup thereof copied to the flash memory, and the backup copy of the window-information set is replaced with a one of the window-information sets stored in the window-information block corresponding to the user-selected window to set the user-selected window as the active window.
In one preferred embodiment of the invention, the checking of whether the window-information set loaded in the flash memory is correct is based on the writing block indicator and the spare block indicator.
Moreover, the foregoing step of checking whether the content of the window-information set is based on the criteria: (1) verifying that an error correction code in the window information is correct; (2) verifying that a check sum code in the window information is correct; (3) verifying that the spare block is an erased block; (4) verifying that the contents of a logic block number, a cycle counter, and the last accessed sector in the writing block are consistent with the contents of the writing block indicator; and (5) verifying that the content of a phase-lock flag in the writing block is unequal to the value used to indicate the first blank sector in the window-information block.
If the content of the window-information set is incorrect, one preferred embodiment of the invention performs the step of looking through the previous window information sets stored in the window-information blocks for the last usable window-information set; wherein the usable window-information set is the window-information set that contains the correctable error correction code and the correct check sum code in the window-information.
Another preferred embodiment of the invention performs the step of finding all the blocks belonging to the window in the flash memory for rebuilding the window-information set.
Still moreover, the invention proposes an access method for a window-based flash memory storage system including a flash memory unit having a window-based region and a redundant reserved region and including a plurality of buffer areas. In the window information area of the redundant reserved region, each window-information set is associated with a specific window having a number of physical blocks. By this access method according to the invention, the first step is to load the window-information set of a user-selected window into an SRAM; and then find a requested sector requested by a data-access requesting component, and then loading the requested sector from the flash memory into one of the buffer areas. Next, the requested sector currently loaded in one of the buffer areas is transferred to the data-access requesting component. The foregoing two steps of transferring all the requested sectors to the data-access requesting component are performed in a parallel pipelined manner.
Furthermore, the invention proposes another access method for a window-based flash memory storage system including a flash memory unit having a window-based region and a redundant reserved region and including a plurality of buffer areas. In the window-information area of the redundant region, each window information set is associated with a specific window having a number of physical blocks. By this access method according to the invention, the first step is to transfer writing sector that is to be written into the flash memory to one of the buffer areas, and then computing for the address of the writing sector in the flash memory. Then, it is checked whether the previous read operation on the flash memory is correct; and then issuing a write-enable signal to the flash memory and then transferring the writing sector to the flash memory. The foregoing two steps of transferring all the requested sectors to the data-access requesting component are performed in a parallel pipelined manner.
In conclusion, the invention is characterized by the use of the redundant reserved region to store the related window information of each window as well as the use of Fast Buildup Method, Normal Buildup Method, and Block-by-Block Search Buildup Method to help build the required window information to quickly initiate the window-based flash memory storage system. Moreover, the invention also utilizes parallel pipelined operation to enhance the performance of read/write operations.